package com.llxy.cn;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Random;

public class ZJH {


	public static void main(String[] args) 
   {	
    List<String> p = new ArrayList<String>();
    String pM = "";
    for(int i=1;i<14;i++){
    	pM = String.valueOf(i);
    	if(i==11){
         pM="A";
      }else if(i==12){ 	
          pM="J";
       }else if(i==13){ 	
          pM="Q";
      }else if(i==14){ 	
          pM="K";
	   }
     p.add("♥"+pM);
     p.add("♠"+pM);
     p.add("♦"+pM);
     p.add("♣"+pM);
    }
    System.out.println(p);
    Random random = new Random();
    for(int i=0;i<100;i++){
    	int onep = random.nextInt(52);
    	int twop = random.nextInt(52);
    	String onepM = p.get(onep);
    	String twopM = p.get(twop);
    	p.set(onep, twopM);
    	p.set(twop, onepM);
    }
    	System.out.println(p);
    
    int people = 5;
    Map<String, List<String>> map = new HashMap<String, List<String>>();
    for(int i=0;i<=5;i++){
    	List<String> pkp = new ArrayList<String>();
       map.put("玩家"+i, pkp);
    }
    for(int i=0;i<people*3;i++){
    	List<String> list = map.get("玩家"+i%people);
    	String pk = p.get(i);
    	list.add(pk);
    }
    Iterator<String> iterator = map.keySet().iterator();
    while(iterator.hasNext()){
    	String key = iterator.next();
    	List<String> list2 = map.get(key);
    	System.out.println(key);
    	System.out.println(list2);
    }   
    }	
}

